package com.wsx.rpc.grpc.controller;

import com.wsx.rpc.grpc.Cache;
import com.wsx.rpc.grpc.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangshuaixin
 * @Title: com.wsx.rpc.grpc.controller.ServerController
 * @Description: TODO
 * @date 2018/12/26
 */
@RestController
@RequestMapping("/server")
public class ServerController {


    @Autowired
    private DataService dataService;


    @RequestMapping(
            value = "/get/{id}",
            method = {RequestMethod.GET}
    )
    public Cache get(@PathVariable("id") String id) {
        return dataService.get(id);
    }
}
